import { request } from '@pkg/request/src';

export enum Api {
  page = '/contacts/page',
  list = '/contacts/list',
  get = '/contacts/get',
  save = '/contacts/save',
  update = '/contacts/update',
  remove = '/contacts/remove',
}

/**
 * 保存或更新
 * @param params
 * @param isUpdate
 */
export const saveOrUpdate = (params, isUpdate) => {
  let url = isUpdate ? Api.update : Api.save;
  return request.post({ url: url, params });
};

/**
 * 查询详情
 * @param params
 */
export const getBusContacts = (params) => {
  return request.get({ url: Api.get, params });
};
